Skip to content

fix: use active product version [APIAPEX-2731]#75

Merged
DKVON-prog merged 7 commits into
mainfrom
fix/APIAPEX-2731/active-product-version
May 21, 2026
Merged

fix: use active product version [APIAPEX-2731]#75
DKVON-prog merged 7 commits into
mainfrom
fix/APIAPEX-2731/active-product-version

Conversation

@DKVON-prog

Copy link
Copy Markdown
Contributor

No description provided.

@DKVON-prog DKVON-prog force-pushed the fix/APIAPEX-2731/active-product-version branch from 68e636b to 69f3a18 Compare May 5, 2026 06:59
Copilot AI review requested due to automatic review settings May 14, 2026 11:22
@DKVON-prog DKVON-prog force-pushed the fix/APIAPEX-2731/active-product-version branch from 69f3a18 to 14e4503 Compare May 14, 2026 11:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Renames and reworks the datastore lookup so that vcr init resolves a product template's active version (via Products_by_pk.active_version_id) instead of picking the most recently created version, which could be a draft. The interface, mocks, callers, tests, and user-facing strings are updated accordingly.

Changes:

  • Replace GetLatestProductVersionByID with GetActiveProductVersionByID, querying the product's active_version_id and then resolving that version by primary key.
  • Update the init command spinner/error messages and the DatastoreInterface + generated mock to use the new name.
  • Refactor datastore_test.go to support sequenced GraphQL responses and add coverage for empty active id, missing active version, and the "newer draft exists" regression; add a matching error-path test in init_test.go.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/api/datastore.go Implements new two-step active-version lookup with new request/response types and ErrNotFound handling.
pkg/api/datastore_test.go Switches mock to a per-call response sequence and adds new edge-case and regression tests.
pkg/cmdutil/factory.go Renames the method on DatastoreInterface.
testutil/mocks/factory.go Regenerated mock for the renamed method.
vcr/init/init.go Calls the new method and updates spinner/error wording to "active".
vcr/init/init_test.go Renames mock fields and adds an error-path test for active version not found.
Files not reviewed (1)
  • testutil/mocks/factory.go: Language not supported

@DKVON-prog DKVON-prog changed the title APIAPEX-2731 - fix CLI to use active product version fix: use active product version May 18, 2026
@DKVON-prog DKVON-prog changed the title fix: use active product version fix: use active product version [APIAPEX-2731] May 19, 2026
Copilot stopped work on behalf of DKVON-prog due to an error May 19, 2026 07:19
@DKVON-prog DKVON-prog changed the title fix: use active product version [APIAPEX-2731] fix(cli): use active product version [APIAPEX-2731] May 19, 2026
@DKVON-prog DKVON-prog changed the title fix(cli): use active product version [APIAPEX-2731] fix: use active product version [APIAPEX-2731] May 19, 2026
@DKVON-prog DKVON-prog requested a review from Copilot May 19, 2026 07:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • testutil/mocks/factory.go: Language not supported

@DKVON-prog DKVON-prog force-pushed the fix/APIAPEX-2731/active-product-version branch from cd81a73 to d7d9fb3 Compare May 19, 2026 09:27
@DKVON-prog DKVON-prog merged commit d53d198 into main May 21, 2026
9 checks passed
@DKVON-prog DKVON-prog deleted the fix/APIAPEX-2731/active-product-version branch May 21, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants